﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    /// This is an abstract class which builds the base for binarization filters
    /// in comparison to other frameworks we can even declare in a binary
    /// result e.g. yellow as foreground
    /// </summary>
    public abstract class BaseForeBackgroundColorFilter : BaseImageFilter, IBaseForeBackgroundColorFilter, INeigbourFilter
    {
        protected Dictionary<NEIGHBOUR, List<Point>> m_aNeighbour = new Dictionary<NEIGHBOUR, List<Point>>() { 
            {NEIGHBOUR.EIGHT, Definitions.EnvironmentPointListClockwise},
            {NEIGHBOUR.FOUR, Definitions.EnvironmentPointList4Clockwise}
        };

        /// <summary>
        /// This is the neighbouring default.
        /// Default is use 8 neighbours. (diagonal, vertical, horizontal)
        /// </summary>
        protected NEIGHBOUR m_NEIGHBOUR = NEIGHBOUR.EIGHT;
   
        /// <summary>
        /// Use this background color
        /// </summary>
        protected Color m_ColorBackground = Definitions.Black;

        /// <summary>
        /// Use this foreground color
        /// </summary>
        protected Color m_ColorForeground = Definitions.White;

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseForeBackgroundColorFilter"/> class.
        /// </summary>
        public BaseForeBackgroundColorFilter()
        {
        }

        /// <summary>
        /// Gets or sets the neighbour.
        /// </summary>
        /// <value>The neighbour.</value>
        public NEIGHBOUR Neighbour
        {
            get { return m_NEIGHBOUR; }
            set { m_NEIGHBOUR = value; }
        }

        /// <summary>
        /// Gets or sets the color of the background.
        /// </summary>
        /// <value>The color of the background.</value>
        public Color BackgroundColor
        {
            get { return m_ColorBackground; }
            set { m_ColorBackground = value; }
        }

        /// <summary>
        /// Gets or sets the foreground.
        /// </summary>
        /// <value>The foreground.</value>
        public Color Foreground
        {
            get { return m_ColorForeground; }
            set { m_ColorForeground = value; }
        }
    }
}
